﻿using System;
using System.Buffers;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Unity.String.Exceptions;
using Unity.String.Text.Charset;
using Xunit;

namespace Unity.String.Tests.Text
{
    public class Utf8ValueStringBuilderTest
    {
	    [Fact]
	    public void ConstructorTest()
	    {
		    Utf8ValueStringBuilder testUtf8ValueStringBuilderWithDisposeImmediately =
			    new Utf8ValueStringBuilder(true);
		    
		    Assert.Throws<NestedStringBuilderCreationException>(() =>
		    {
			    Utf8ValueStringBuilder testUtf8ValueStringBuilderWithScratchBufferUsed =
				    new Utf8ValueStringBuilder(true);
		    });
	    }
	    
        [Fact]
        public void AppendFormatTest()
        {
            {
                Utf8ValueStringBuilder testUtf8ValueStringBuilderWithDisposeImmediately = new
                    Utf8ValueStringBuilder(true);
                
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4);
                });Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
                });
                Assert.Throws<ArgumentNullException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(null, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
                });
                
                testUtf8ValueStringBuilderWithDisposeImmediately
				.AppendFormat(" {{}} ",
					0);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
				testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} ",
							0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);

                Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
				});
				Assert.Throws<FormatException>(() =>
				{
					testUtf8ValueStringBuilderWithDisposeImmediately
						.AppendFormat(" {{}} } ", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
				});
                
                
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
                });
                Assert.Throws<FormatException>(() =>
                {
	                testUtf8ValueStringBuilderWithDisposeImmediately.AppendFormat(" {", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
                });
                
                
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}", 0);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}", 0, 1);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}", 0, 1, 2);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}", 0, 1, 2, 3);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}", 0, 1, 2, 3, 4);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}", 0, 1, 2, 3, 4, 5);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}", 0, 1, 2, 3, 4, 5, 6);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}", 0, 1, 2, 3, 4, 5, 6, 7);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}", 0, 1, 2, 3, 4, 5, 6, 7, 8);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14);
                testUtf8ValueStringBuilderWithDisposeImmediately
                    .AppendFormat("{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}, {12}, {13}, {14}, {15}", 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
                
            }
            

            {
                Utf8ValueStringBuilder testUtf8ValueStringBuilderWithoutDisposeImmediately = new
                    Utf8ValueStringBuilder(true);
            }
        }

        [Fact]
        public void AppendTest()
        {
	        const int bufferLimit = 65536;
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTime testDateTimeValue = DateTime.Now;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDateTimeValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTime testDateTimeValue = DateTime.Now;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDateTimeValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTimeOffset testDateTimeOffsetValue = DateTime.UtcNow;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDateTimeOffsetValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTimeOffset testDateTimeOffsetValue = DateTime.UtcNow;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDateTimeOffsetValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Decimal testDecimalValue = 123m;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDecimalValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Decimal testDecimalValue = 123m;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDecimalValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Guid testGuidValue = Guid.NewGuid();
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testGuidValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Guid testGuidValue = Guid.NewGuid();
		        StandardFormat testStandardFormat = new StandardFormat('N'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testGuidValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        TimeSpan testTimeSpanValue = DateTime.Now.Subtract(DateTime.Today);
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testTimeSpanValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        TimeSpan testTimeSpanValue = DateTime.Now.Subtract(DateTime.Today);
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testTimeSpanValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        bool testBoolValue = true;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testBoolValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        bool testBoolValue = true;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testBoolValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        byte testByteValue = 07;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testByteValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        byte testByteValue = 07;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testByteValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = 'a';
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testCharValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = 'a';
		        int testRepeatCount = 3; 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testCharValue, testRepeatCount);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = 'a';
		        int testRepeatCount = -3;
		        Assert.Throws<ArgumentOutOfRangeException>(() =>
		        {
			        testUtf8ValueStringBuilder.Append(testCharValue, testRepeatCount);
		        });
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = (char) 255;
		        int testRepeatCount = 3; 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testCharValue, testRepeatCount);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        double testDoubleValue = 123.456;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDoubleValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        double testDoubleValue = 123.456;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testDoubleValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        float testFloatValue = 123.456f;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testFloatValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        float testFloatValue = 123.456f;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testFloatValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        int testIntValue = 123;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testIntValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        int testIntValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testIntValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        long testLongValue = 123456789L;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testLongValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        long testLongValue = 123456789L;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testLongValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        sbyte testSignedByteValue = -07;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testSignedByteValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        sbyte testSignedByteValue = -07;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testSignedByteValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        short testShortValue = 123;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testShortValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        short testShortValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testShortValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        uint testUnsignedIntValue = 123u;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedIntValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        uint testUnsignedIntValue = 123u;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedIntValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ulong testUnsignedLongValue = 123456789UL;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedLongValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ulong testUnsignedLongValue = 123456789UL;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedLongValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ushort testUnsignedShortValue = 123;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedShortValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ushort testUnsignedShortValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G'); 
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testUnsignedShortValue, testStandardFormat);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        string testStringValue = "abcdef";
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testStringValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        string testStringValue = "abcdef";
		        int testStartIndex = 2;
		        int testCount = 4;
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testStringValue, testStartIndex, testCount);
		        }

		        testUtf8ValueStringBuilder.Append(null, 0, 0);
		        Assert.Throws<ArgumentNullException>(() =>
		        {
			        testUtf8ValueStringBuilder.Append(null, testStartIndex, testCount);
		        });
		        
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ReadOnlySpan<char> testReadOnlySpanCharArrayValue = "abcdef".AsSpan();
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append(testReadOnlySpanCharArrayValue);
		        }
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        while (testUtf8ValueStringBuilder.Length <= bufferLimit)
		        {
			        testUtf8ValueStringBuilder.Append<List<string>>(testListStringValue);
		        }
	        }
        }

        [Fact]
        public void AppendLineTest()
        {
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        testUtf8ValueStringBuilder.AppendLine();
	        }

	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTime testDateTimeValue = DateTime.Now;
		        testUtf8ValueStringBuilder.AppendLine(testDateTimeValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTime testDateTimeValue = DateTime.Now;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testDateTimeValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTimeOffset testDateTimeOffsetValue = DateTime.UtcNow;
		        testUtf8ValueStringBuilder.AppendLine(testDateTimeOffsetValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        DateTimeOffset testDateTimeOffsetValue = DateTime.UtcNow;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testDateTimeOffsetValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Decimal testDecimalValue = 123m;
		        testUtf8ValueStringBuilder.AppendLine(testDecimalValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Decimal testDecimalValue = 123m;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testDecimalValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Guid testGuidValue = Guid.NewGuid();
		        testUtf8ValueStringBuilder.AppendLine(testGuidValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Guid testGuidValue = Guid.NewGuid();
		        StandardFormat testStandardFormat = new StandardFormat('N');
		        testUtf8ValueStringBuilder.AppendLine(testGuidValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        TimeSpan testTimeSpanValue = DateTime.Now.Subtract(DateTime.Today);
		        testUtf8ValueStringBuilder.AppendLine(testTimeSpanValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        TimeSpan testTimeSpanValue = DateTime.Now.Subtract(DateTime.Today);
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testTimeSpanValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        bool testBoolValue = true;
		        testUtf8ValueStringBuilder.AppendLine(testBoolValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        bool testBoolValue = true;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testBoolValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        byte testByteValue = 07;
		        testUtf8ValueStringBuilder.AppendLine(testByteValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        byte testByteValue = 07;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testByteValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = 'a';
		        testUtf8ValueStringBuilder.AppendLine(testCharValue);
	        }

	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        char testCharValue = 'a';
		        int testRepeatCount = -3;
		        
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        double testDoubleValue = 123.456;
		        testUtf8ValueStringBuilder.AppendLine(testDoubleValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        double testDoubleValue = 123.456;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testDoubleValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        float testFloatValue = 123.456f;
		        testUtf8ValueStringBuilder.AppendLine(testFloatValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        float testFloatValue = 123.456f;
		        StandardFormat testStandardFormat = new StandardFormat('G', 2);
		        testUtf8ValueStringBuilder.AppendLine(testFloatValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        int testIntValue = 123;
		        testUtf8ValueStringBuilder.AppendLine(testIntValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        int testIntValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testIntValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        long testLongValue = 123456789L;
		        testUtf8ValueStringBuilder.AppendLine(testLongValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        long testLongValue = 123456789L;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testLongValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        sbyte testSignedByteValue = -07;
		        testUtf8ValueStringBuilder.AppendLine(testSignedByteValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        sbyte testSignedByteValue = -07;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testSignedByteValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        short testShortValue = 123;
		        testUtf8ValueStringBuilder.AppendLine(testShortValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        short testShortValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testShortValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        uint testUnsignedIntValue = 123u;
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedIntValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        uint testUnsignedIntValue = 123u;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedIntValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ulong testUnsignedLongValue = 123456789UL;
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedLongValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ulong testUnsignedLongValue = 123456789UL;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedLongValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ushort testUnsignedShortValue = 123;
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedShortValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ushort testUnsignedShortValue = 123;
		        StandardFormat testStandardFormat = new StandardFormat('G');
		        testUtf8ValueStringBuilder.AppendLine(testUnsignedShortValue, testStandardFormat);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        string testStringValue = "abcdef";
		        testUtf8ValueStringBuilder.AppendLine(testStringValue);
	        }
	        
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ReadOnlySpan<char> testReadOnlySpanCharArrayValue = "abcdef".AsSpan();
		        testUtf8ValueStringBuilder.AppendLine(testReadOnlySpanCharArrayValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        testUtf8ValueStringBuilder.AppendLine<List<string>>(testListStringValue);
	        }
        }

        [Fact]
        public void AppendJoinTemplateTest()
        {
	        const char testCharSeparator = '|';
	        const string testStringSeparator = "=>";

	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        string[] testStringArrayValue = new string[] { "abc", "def", "ghi" };
		        testUtf8ValueStringBuilder.AppendJoin<string[]>(testCharSeparator, testStringArrayValue);
		        testUtf8ValueStringBuilder.AppendJoin<string[]>(testStringSeparator, testStringArrayValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testListStringValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testListStringValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ReadOnlySpan<char> testReadOnlySpanValue = "abcdefghi".AsSpan();
		        testUtf8ValueStringBuilder.AppendJoin<char>(testCharSeparator, testReadOnlySpanValue);
		        testUtf8ValueStringBuilder.AppendJoin<char>(testStringSeparator, testReadOnlySpanValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        IEnumerable<string> testEnumerableValue = testListStringValue.AsEnumerable();
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testEnumerableValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testEnumerableValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        ICollection<string> testICollectionValue = (ICollection<string>)testListStringValue;
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testICollectionValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testICollectionValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        IList<string> testIListValue = (IList<string>) testListStringValue;
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testIListValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testIListValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        IReadOnlyList<string> testIReadOnlyListValue = (IReadOnlyList<string>) testListStringValue;
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testIReadOnlyListValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testIReadOnlyListValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        List<string> testListStringValue = new List<string>() { "abc", "def", "ghi" };
		        IReadOnlyCollection<string> testIReadOnlyCollectionValue = (IReadOnlyCollection<string>) testListStringValue;
		        testUtf8ValueStringBuilder.AppendJoin<string>(testCharSeparator, testIReadOnlyCollectionValue);
		        testUtf8ValueStringBuilder.AppendJoin<string>(testStringSeparator, testIReadOnlyCollectionValue);
	        }
        }

        [Fact]
        public void OtherMethodsTest()
        {
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ArraySegment<byte> returnArraySegmentValue = testUtf8ValueStringBuilder.AsArraySegment();
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ReadOnlyMemory<byte> returnArraySegmentValue = testUtf8ValueStringBuilder.AsMemory();
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        ReadOnlySpan<byte> returnArraySegmentValue = testUtf8ValueStringBuilder.AsSpan();
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        testUtf8ValueStringBuilder.Clear();
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        IBufferWriter<byte> testBufferWriter = new ArrayBufferWriter<byte>();
		        testUtf8ValueStringBuilder.CopyTo(testBufferWriter);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Span<byte> testSpanValue = new byte[1024].AsSpan();
		        bool returnTryCopyValue = testUtf8ValueStringBuilder.TryCopyTo(testSpanValue, out int returnBytesWritten);
		        Span<byte> testEmptySpanValue = Array.Empty<byte>().AsSpan();
		        testUtf8ValueStringBuilder.Append("abcdef");
		        bool returnEmptyTryCopyValue = testUtf8ValueStringBuilder.TryCopyTo(testSpanValue, out int returnEmptyBytesWritten);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        int defaultBufferSize = 65536;
		        int testSizeHintValue = 8;
		        Memory<byte> returnMemoryValue = testUtf8ValueStringBuilder.GetMemory(defaultBufferSize + testSizeHintValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        string returnEmptyStringValue = testUtf8ValueStringBuilder.ToString();
		        testUtf8ValueStringBuilder.Append("abcdef");
		        string returnStringValue = testUtf8ValueStringBuilder.ToString();
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Stream testWriteToAsyncStream = new MemoryStream();
		        Task returnWriteToAsyncTask = testUtf8ValueStringBuilder.WriteToAsync(testWriteToAsyncStream);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        Stream testWriteToAsyncStream = new MemoryStream();
		        CancellationToken testCancellationTokenValue = new CancellationToken(true);
		        Task returnWriteToAsyncTask = testUtf8ValueStringBuilder.WriteToAsync(testWriteToAsyncStream, testCancellationTokenValue);
	        }
	        
	        {
		        Utf8ValueStringBuilder testUtf8ValueStringBuilder =
			        new Utf8ValueStringBuilder(false);
		        IResettableBufferWriter<byte> testBufferWriter = (IResettableBufferWriter<byte>) testUtf8ValueStringBuilder;
		        testBufferWriter.Reset();
	        }

	        {
		        Utf8ValueStringBuilder.TryFormat<string> testTryFormatStringDelegate =
			        (string value, Span<byte> destination, out int written, StandardFormat format) =>
			        {
				        written = 0;
				        return true;
			        };
		        Utf8ValueStringBuilder.RegisterTryFormat(testTryFormatStringDelegate);
	        }

	        {
		        Utf8ValueStringBuilder.TryFormat<Byte> testTryFormatByteDelegate 
			        = Utf8ValueStringBuilder.FormatterCache<Byte>.TryFormatDelegate;
		        
		        Utf8ValueStringBuilder.TryFormat<TestEnum> testTryFormatCustomEnum
			        = Utf8ValueStringBuilder.FormatterCache<TestEnum>.TryFormatDelegate;
	        }
        }
        
        enum TestEnum
        {
	        TestZero = 0,
			TestOne = 1,
			TestTwo = 2
        }
    }
}